<?php

	header("Content-Type: text/html;charset=utf-8"); 

	include("../function/_nosql.php");

	include("../function/function.php");
	$URL = $_SERVER['REQUEST_URI'];
	$newsid = chkstr(trim($_REQUEST['newsid']));
	$ty = chkstr(trim($_REQUEST['ty']));
		if($ty != 1){
			erro("“同意”后才能报名");
		}
	if(is_numeric($newsid)){



		$sql="select * from kboy_forum_active where id=$newsid";



		$rows=mysql_query($sql);



		$nums=mysql_num_rows($rows);



		if($nums>0){



			$rs=mysql_fetch_array($rows);


				$active_title = $rs['active_title'];          //



				$active_bigclass = $rs['active_bigclass'];

				$active_renzheng = $rs['active_renzheng'];

				$active_mingyi = $rs['active_mingyi'];



				$active_fanwei = $rs['active_fanwei'];



				$active_xianzhi = $rs['active_xianzhi'];



				$active_all_money = $rs['active_all_money'];//
				
				$active_cva_money = $rs['active_cva_money'];
				
				$active_part_money = $rs['active_part_money'];//
				$active_tian = $rs['active_tian'];
				
				$active_end_user = $rs['active_end_user'];



				$active_text = $rs['active_text'];//


				$active_pic = explode(',', $rs['active_pic']);		//

				
				if(!empty($rs['active_sollimg'])){
					$active_sollimg = explode(',', $rs['active_sollimg']);
				}
				$active_hd_content = $rs['active_hd_content'];
				$active_all_line = $rs['active_all_line'];

				$active_start_prov = $rs['active_start_prov'];



				$active_start_city = $rs['active_start_city'];



				$active_end_prov = $rs['active_end_prov'];



				$active_end_city = $rs['active_end_city'];



				$active_start_time = $rs['active_start_time'];



				$active_end_time = $rs['active_end_time'];



				$active_power = $rs['active_power'];



				$active_post_time = $rs['active_post_time'];



				$active_center = $rs['active_center'];



				$active_center_time = $rs['active_center_time'];



				$active_jingdian = $rs['active_jingdian'];



				$active_traffic = $rs['active_traffic'];



				$active_traffic_info = $rs['active_traffic_info'];



				$active_contact = $rs['active_contact'];



				$active_contact_people = $rs['active_contact_people'];



				$active_contact_phone = $rs['active_contact_phone'];



				$active_people = $rs['active_people'];



				$active_line = stripslashes($rs['active_line']);



				$active_xingcheng = stripslashes($rs['active_xingcheng']);



				$active_zhuangbei = stripslashes($rs['active_zhuangbei']);



				$active_baoming = stripslashes($rs['active_baoming']);



				$active_ditu = stripslashes($rs['active_ditu']);



				$active_koubei = stripslashes($rs['active_koubei']);



				$active_addtime = $rs['active_addtime'];



				$uid = $rs['uid'];



				$active_id = $rs['id'];



				$active_transport=$rs['active_transport'];



				$active_charge_details=$rs['active_charge_details'];



				$active_favor = $rs['active_favor'];

				$active_object=$rs['active_object'];



				



				$news_content = stripslashes($rs['travel_content']);



				$news_hit = $rs['travel_hit'];



				$uid = $rs['uid'];



				$active_hits = $rs['active_hits']+1;



				$sql_up = " update kboy_forum_active set `active_hits`=$active_hits where id =$active_id";



				mysql_query($sql_up);


				



				



		}else{



			echo erro("该信息已被删除或不存在");



		}



	}else{



		echo erro("该信息已被删除或不存在");



	}
	
?>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title><?= $active_title.'_'.$web_titles ?></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<meta name="Keywords" content="<?= $web_keywords ?>" />
		<meta name="Description" content="<?= $web_description ?>" />
		<link rel="stylesheet" type="text/css" href="css/index.css"/>
		<link rel="stylesheet" type="text/css" href="./css/xiangqing.css"/>
		<script type="text/javascript" src="../js/baidutongji.js"></script>
		<script src="./js/jquery-1.10.2.min.js" type="text/javascript" charset="utf-8"></script>
		<style type="text/css">
			@media screen and (max-width:320px ) {
				.login-bd .login_chest1{
					width: 80px !important;
				}
			}
		</style>
	</head>
	<body style="background:#BAD3F0;">
			<div class="login-box">
				<div class="quxiao" onclick="history.go(-1)" ><a href="javascript:;"></a><</div> 
			<div class="title">请填写报名信息</div>
				<form name="regform" id="regform" method="post" action="../alert.yuphone.php">
				<input type="hidden" name="redirect_urls" id="redirect_urls" value="<?=$redirect_urls?>" />
				<input type="hidden" name="newsid" id="newsid" value="<?=$newsid?>" />
				<input type="hidden" name="URL" id="URL" value="<?=$URL?>" />
				<input type="hidden" name="ty" id="ty" value="<?=$ty?>" />
                <div class="login-bd pt24">
                    <div class="f-login-wrap">
                        <div class="f-login-pane current">
		                    <div class="f-login">
		                        <input name="user_phone" id="user_phone" type="text" placeholder="请输入手机号" class="login-input login_mess1" value="">
		                    </div>
		                    <p class="phone_text"></p>
		                    <div class="f-login">
		                        <input name="user_phonecode" type="text" class="login-input login_chest1" id="user_phonecode" value="" placeholder="验证码">
		                        <span class="get-yzm">
		                        	<a href="javascript:;" class="noyzm" >获取验证码</a>
		                        	<a href="javascript:;" class="yesyzm" ><span>60</span>s后再获取</a>
								</span>
		                    </div>
		                    <p></p>
		                    <div class="f-login">
		                        <input name="user_nickname" id="user_nickname" type="text" placeholder="昵称" class="login-input login_name" value="">
		                    </div>
		                     <p></p>
		                    <div class="f-login">
		                        <input name="user_realname" id="user_realname" type="text" placeholder="请输入真实姓名" class="login-input login_name" value="">
		                    </div>
		                    <p class="password_text"></p>
		                    <div class="f-login">
		                        <input name="user_idcard" id="user_idcard" type="text" placeholder="请输入身份证" class="login-input login_password" value="">
		                    </div>
		                    	<?php 
		                    		$active_center=explode("，",$active_center);
		                    		if(is_array($active_center)){ ?>
		                    	<p class="password_text"></p>
		                    <div class="f-login">
		                    	<select name="shangche">
		                    		<option value="">请选择集合地点</option>
		                    		<?php foreach ($active_center as $k => $v) { ?>
		                    			<option value="<?=$v?>"><?=$v?></option>
		                    		<?php } ?>
		                    	</select>
		                    </div>
		                    	<?php }else{ ?>
		                    		<p class="password_text"></p>
				                    <div class="f-login">
				                    	
				                        <input name="shangche" id="shangche" type="text" class="login-input login_password" value="$active_center">
				                    </div>
		                    	<?php } ?>
		                    <div class="login-btn">
									<input type="submit" name="reg_btn" class="basic-btn" value="直接报名" />
								<br />
							</div>                           
                        </div>
                        
                    </div>
                </div>
				</form>
            </div>

			
	</body>
	</html>
	<script type="text/javascript" src="../js/alert.js"></script>
	<script type="text/javascript" src="../layer/layer.js"></script>

	<script>
    $(document).ready(function() {
        $(".gengduo .xiany a").click(function(){
        	var a = $(this).offset().top;
            $(this).addClass("on").closest(".xiany").siblings(".xiany").find(".xing").slideUp("xiany").siblings("a").removeClass("on");
            $(this).removeClass("on").next(".xing").slideToggle("xiany");
            $('body,html').animate({'scrollTop':a},500)
        });

    });
</script>
<script type="text/javascript">
		$(".noyzm").click(function(){
			var phone = $("input[name=user_phone]").val();
			if(phone.replace(/\ /g,"").length<1){
				alert("手机不能为空！");
				return false;
			}
			$.ajax({
				type:"post",
				url:"/duanxin/fileTest.php",
				data:{phone:phone},
				dataType:"json",
				success:function(data){
					if(data == 1){
						var str = '<div class="award-box"><div class="award-hd"><div class="award-tips"><img src="../images/confirm.png" alt=""/></div><div class="award-notice">验证码我们已经通过短信形式发送到</br>您的手机号'+phone+'，请注意查收！</div><span class="rect"></span></div><span class="layui-layer-setwin"><a class="layui-layer-ico layui-layer-close layui-layer-close2" href="javascript:;"></a></span></div>';
						$("body").append(str);
						$(".layui-layer-close").on("click",function(){
							$(".award-box").remove();
						})
					}else if(data == 3){
						alert("手机不能为空");
					}else if(data == 2){
						alert("系统忙请重新发送");
					}
				}
			});
			$(this).hide();
			$(".yesyzm").show().css({"background":"#919191","cursor":"not-allowed"});
			t = setInterval(function(){
				var yes = $(".yesyzm span").html();
				var newyes = yes - 1 ;
				$(".yesyzm span").html(newyes);
				if(newyes == 0){
						clearInterval(t);
						$(".yesyzm span").html(60);
						$(".noyzm").show();
						$(".yesyzm").hide();
				}
			},1000)
		})
	</script>
<script type="text/javascript">
	$("#regform").submit(function(){
			var user_phone = $("#user_phone").val();
			var user_phone_rule = /^1[134578]\d{9}$/;
			var user_phonecode = $("#user_phonecode").val();
			// 手机号验证
			if(!user_phone_rule.test(user_phone)){
				alert("手机号格式错误！！");
				$("#user_phone").focus();
				return false;
			}
			// 验证码验证
			if (user_phonecode.replace(/\ /g,"").length<1){
				alert("请正确输入验证码！");
				$("#user_phonecode").focus();
				return false;
			}
		})

	$("input[name=user_phonecode]").blur(function(){
			
			var yzm = $(this).val()+','+$("input[name=user_phone]").val();
			$.ajax({
				type:"post",
				url:"../alert.yuphone.php?yzm=val",
				data:{yzm:yzm},
				dataType:"json",
				success:function(data){
					if(data == 8){
						alert("验证码已失效");
					}
					if(data == 7){
						alert("手机失效，重新输入");
					}
					if(data !=1 ){
						$("input[name=user_realname]").val(data[0]);
						$("input[name=user_idcard]").val(data[1]);
						$("input[name=user_nickname]").val(data[2]);
					}else{
						$("input[name=user_realname]").val('');
						$("input[name=user_idcard]").val('');
						$("input[name=user_nickname]").val('');
						alert('验证码错误')
					}
					
				}
			});
		})
</script>
